package com.jrx.anytxn.reporting.job.payment.step;

import com.jrx.anytxn.reporting.bean.PaymentDataBean;
import com.jrx.anytxn.reporting.bean.ReportingDataBean;
import com.jrx.anytxn.reporting.service.IPaymentLogDataService;
import org.springframework.batch.item.ItemWriter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AutoAssemPaymentLogWriter implements ItemWriter<PaymentDataBean> {

    @Autowired
    private IPaymentLogDataService paymentLogDataService;

    @Override
    public void write(List<? extends PaymentDataBean> list) throws Exception {
        for(PaymentDataBean paymentDataBean : list){
            paymentLogDataService.generatePaymentLogInfo(paymentDataBean);
        }
    }
}
